package ar.edu.utn.frba.dds.tp.transformers;

import java.math.BigDecimal;

import org.uqbar.arena.bindings.Transformer;

public class BigDecimalToStringTransformer implements Transformer<BigDecimal, String> {

	@Override
	public Class<BigDecimal> getModelType() {
		return BigDecimal.class;
	}

	@Override
	public Class<String> getViewType() {
		return String.class;
	}

	@Override
	public String modelToView(BigDecimal big_dec) {
		return big_dec.toPlainString();
	}

	@Override
	public BigDecimal viewToModel(String s) {
		return new BigDecimal(s);
	}

}
